/**
 * 
 * @Project HRL Simulation
 * @Date 20.06.2011
 * @Author Aebi Pascal, Kocher Marc, Sriranjan George
 * @School BFH-TI Biel, Projekt 1
 *
 */

package strategy;

import elements.Load;
import exceptions.ResourceException;


/**
 * This interface represents different calculation strategies for the hrl
 */
public interface Strategy {

	/**
	 * This method contains the strategy intelligence for all bookings into racks
	 * It adds agenda entries to the different agendas of all needed resources
	 * 
	 * @param load
	 * @throws ResourceException calculate route error
	 */
	public void bookLoadIn(Load load) throws ResourceException;
	
	
	/**
	 * This method contains the strategy intelligence for all bookings from racks to exit
	 * It adds agenda entries to the different agendas of all needed resources
	 * 
	 * @param load
	 * @throws ResourceException calculate route error
	 */
	public void bookLoadOut(Load load) throws ResourceException;
	
	
	/**
	 * This method handles collisions on the conveyor when booking in
	 * For example if an input buffer is already occupied when a load is arriving
	 * the strategy has to decide the next step
	 *
	 * @param failureID
	 * @throws ResourceException calculate route error
	 */
	public void handleBookInConflict(int failureID) throws ResourceException;
	
	
	/**
	 * This method handles collisions on the conveyor when booking out
	 * For example if an output buffer puts a load on the conveyor at same time it is 
	 * planed to pass a load the strategy has to decide the next step
	 *
	 * @param failureID
	 * @throws ResourceException calculate route error 
	 */
	public void handleBookOutConflict(int failureID) throws ResourceException;
	
	
	/**
	 * This method books all agenda entries to the given load
	 * @throws ResourceException Resource not found
	 */
	public void bookLoadRoute(Load load) throws ResourceException;
}

